<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset="utf-8">
    <link rel="stylesheet" href="https://unpkg.com/leaflet@1.6.0/dist/leaflet.css" />
    <script src="https://unpkg.com/leaflet@1.6.0/dist/leaflet.js"></script>
    <script src="https://cdn.bootcss.com/proj4js/2.4.3/proj4.js"></script>
    <script src="https://cdn.bootcss.com/proj4leaflet/1.0.1/proj4leaflet.min.js"></script>
    <script type="text/javascript" src='leaflet.ChineseTmsProviders.js'></script>
    <style type="text/css">
        body {
            padding: 0;
            margin: 0;
        }
        html, body, #map {
            height: 100%;
        }
    </style>
</head>

<body>
    <div id='map'></div>
</body>
</html>

<script>
    // layers
    var normalm = L.tileLayer.chinaProvider('TianDiTu.Normal.Map', { maxZoom: 18, minZoom: 5 });
    var normala = L.tileLayer.chinaProvider('TianDiTu.Normal.Annotion', { maxZoom: 18, minZoom: 5 });
    var imgm = L.tileLayer.chinaProvider('TianDiTu.Satellite.Map', { maxZoom: 18, minZoom: 5 });
    var imga = L.tileLayer.chinaProvider('TianDiTu.Satellite.Annotion', { maxZoom: 18, minZoom: 5 });
    var normal = L.layerGroup([normalm, normala]);
    var image = L.layerGroup([imgm, imga]);
    var baseLayers = {
        "地图": normal,
        "影像": image,
    }
    var overlayLayers = {
    }

    // map
    var map = L.map("map", {
        center: [39.9244, 116.4035],
        zoom: 12,
        layers: [normal],
        zoomControl: false
    });

    // controls
    L.control.layers(baseLayers, overlayLayers).addTo(map);
    L.control.zoom({
        zoomInTitle: '放大',
        zoomOutTitle: '缩小'
    }).addTo(map);

    // event
    map.on('click', function (e) {
        var zoomLevel = map.getZoom();
        var lat = e.latlng.lat;
        var lng = e.latlng.lng;
        clipboardData.setData("text", "jwd:" + lng + "," + lat + ";pmzb:0.0,0.0;level:" + zoomLevel);
        alert(lng + " " + lat + " 当前级别:" + zoomLevel);
    })
</script>